package com.changgou.goods.dao;
import com.changgou.goods.pojo.Brand;
import com.changgou.goods.pojo.Category;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

/****
 * @Author:admin
 * @Description:Brand的Dao
 * @Date 2019/6/14 0:12
 *****/
public interface BrandMapper extends Mapper<Brand> {

    /**
     * 根据分类id 查询品牌集合
     *
     */
    @Select("SELECT tb.* FROM tb_category_brand tbc , tb_brand tb \n" +
            "WHERE tb.id=tbc.brand_id AND tbc.category_id = #{pid}")
    List<Brand> findByCategoryId(Integer pid);
}
